Skip to content

feat: add logout command#46

Merged
efenocchi merged 3 commits intomainfrom
feat/logout-command
Apr 14, 2026
Merged

feat: add logout command#46
efenocchi merged 3 commits intomainfrom
feat/logout-command

Conversation

@kaghni
Copy link
Copy Markdown
Collaborator

@kaghni kaghni commented Apr 13, 2026

Adds logout command that removes ~/.deeplake/credentials.json.

@claude
Copy link
Copy Markdown

claude bot commented Apr 13, 2026

Claude finished @kaghni's task in 59s —— View job


Two issues found:

  • Path duplicationlogout re-derives ~/.deeplake/credentials.json independently from CREDS_PATH in auth.ts. Export a deleteCredentials() from auth.ts and call it here.
  • Unnecessary dynamic importsnode:fs/path/os should be static imports (or avoided entirely if delegating to auth.ts).

Comment thread src/commands/auth-login.ts Outdated
const { existsSync, unlinkSync } = await import("node:fs");
const { join } = await import("node:path");
const { homedir } = await import("node:os");
const credFile = join(homedir(), ".deeplake", "credentials.json");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The credentials path is re-derived here instead of reusing the CREDS_PATH constant already defined in auth.ts — if the path ever changes there, logout won't follow. Export a deleteCredentials() function from auth.ts (wrapping unlinkSync(CREDS_PATH)) and call it here instead.

Comment thread src/commands/auth-login.ts Outdated
Comment on lines +139 to +141
const { existsSync, unlinkSync } = await import("node:fs");
const { join } = await import("node:path");
const { homedir } = await import("node:os");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dynamic imports for node:fs, node:path, and node:os are unnecessary — these are static built-ins already imported at the top of auth.ts. Use static imports at the top of this file (or better, delegate to a deleteCredentials() in auth.ts as noted above).

@efenocchi efenocchi merged commit 6d2d472 into main Apr 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants